package jp.co.worksap.ate.gomoku.localai;

import java.util.List;

import jp.co.worksap.ate.gomoku.model.GoState;
import jp.co.worksap.ate.gomoku.model.Goban;

public class GobanNode {
	private double attackScore;
	private double defenceScore;
	private double score;
	private double levelProb;
	private double totalProb;
	private GoState goType;
	private Goban goban;
	private int x;
	private int y;
	public GobanNode(Goban goban, GoState goType, int x, int y) {
		goban.putGo(x, y, goType);
		GoState enemyType;
		if(goType == GoState.BLACK) {
			enemyType = GoState.WHITE;
		} else {
			enemyType = GoState.BLACK;
		}
		attackScore = LocalAIUtil.computeGoScoreForOneSide(goban, goType, x, y);
		defenceScore = LocalAIUtil.computeGoScoreForOneSide(goban, enemyType, x, y);
		score = attackScore + defenceScore;
		this.goType = goType;
		this.goban = goban;
		this.x = x;
		this.y = y;
	}
	public double getAttackScore() {
		return attackScore;
	}
	public double getDefenceScore() {
		return defenceScore;
	}
	public double getScore() {
		return score;
	}
	public void setLevelProb(double levelProb) {
		this.levelProb = levelProb;
	}
	public double getLevelProb() {
		return levelProb;
	}
	public void setTotalProb(double totalProb) {
		this.totalProb = totalProb;
	}
	public double getTotalProb() {
		return totalProb;
	}
	public GoState getGoType() {
		return goType;
	}
	public Goban getGoban() {
		return goban;
	}
	public int getX() {
		return x;
	}
	public int getY() {
		return y;
	}
}
